<template>
	<view :class="['page',{'iphoneX':isIphoneX}]"> 
		<view class="body">
			<web-view :src="url"></web-view>
		</view> 
	</view>
</template>

<script>
	import {
		HOST
	} from '@/config.js'
	export default{
		name:'',
		data(){
			return {
				isIphoneX: getApp().globalData.isIphoneX,
				appid:getApp().globalData.appid,
				token:uni.getStorageSync('token'),
				userInfo:uni.getStorageSync('userInfo'),
				loginStateUpdate: false,
				dev_type:'',
				dev_id:'',
				url:'',
				host:HOST
			}
		},
		async onLoad(params){
			this.dev_type=params.dev_type;
			
			if(this.dev_type==9){
				// 全景设备
				uni.setNavigationBarTitle({
					title:'全景图预览'
				})
				this.dev_id=params.dev_id;
				this.url=`${this.host}/phone/quanjing.html?device_id=${this.dev_id}`
				
			}
			 
		},
		async onShow() {	
			
			if(this.loginStateUpdate){
				this.token=uni.getStorageSync('token');
				this.userInfo=uni.getStorageSync('userInfo'); 
				this.isLogin=true;
				this.loginStateUpdate=false;
			}
			
			if(this.token){
				this.isLogin=await this.$loginState('check');  
				if(this.isLogin){ 
					
				}else{
					this.isLogin=await this.$loginState('reset');
				}
			}else{
				this.isLogin=await this.$loginState('reset');
			}
			 
		},
		methods:{
			
		},
		computed: { 
			
		}, 
		components: {
			
		},
	}
</script>

<style lang="less">
</style>
